package com.demo.springcloud.controller;

import com.demo.springcloud.common.Request;
import com.demo.springcloud.common.Response;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class RequestContoller {

    @RequestMapping(value = "/common", method = RequestMethod.POST)
    @ResponseBody
    public Response dealCommon(@RequestBody Request request){
        System.out.println(request);
        Response response = new Response();
        response.setId(request.getId());
        response.setMessage("这个是返回结果");
        return response;
    }
}
